from kyb_caps import webdriver, sleep, driver, By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait

# # 输入用户名密码点击登录
driver.find_element(By.ID, 'com.tal.kaoyan:id/login_email_edittext').send_keys('ammyxh01')
driver.find_element(By.ID, 'com.tal.kaoyan:id/login_password_edittext').send_keys('1')
driver.find_element(By.ID, 'com.tal.kaoyan:id/login_login_btn').click()
toast_loc=(By.XPATH,'//*[@text:"验证失败次数过多，请15分钟后再试"]')
ele_toast = WebDriverWait(driver, 30, 0.5).until(EC.presence_of_element_located(toast_loc))
print(ele_toast.text)
sleep(3)
driver.quit()
